package com.example.demo.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author szxt
 *新车信息NewCar2--------》新车录入名字 NewCar1
 */
@Entity
public class NewCar2 {
	
	@Id
	@GeneratedValue
	@JsonIgnore
	private Integer id;
	
	/**
	 * 存新车名称的信息
	 */
	@ManyToOne
	@JsonIgnore
	private NewCar1 newCar;
	
	
	/**
	 * 指导价格
	 */
	private Integer zhiDaoPrice;
	/**
	 * 提车金额
	 */
	private Integer tiCheMoney;
	/**
	 * 数量
	 */
	private Integer many;
	
	/**
	 * 置换补贴
	 */
	private Integer zhiHuanSubsidy;
	
	/**
	 * 预估车型返利金额
	 */
	private Integer fanLiPrice;
	
	/**
	 * 厂家出库日期
	 */
	 @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	 @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date date;
	/**
	 * 能源类型
	 */
	private String type;
	
	/**
	 * 修改日期
	 */
	 @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	 @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonIgnore
	private Date xiuGaiDate;
	 
	 /**
	 * 
	 */
	 @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	 @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endDate;

	public Integer getZhiDaoPrice() {
		return zhiDaoPrice;
	}

	public void setZhiDaoPrice(Integer zhiDaoPrice) {
		this.zhiDaoPrice = zhiDaoPrice;
	}

	public Integer getTiCheMoney() {
		return tiCheMoney;
	}

	public void setTiCheMoney(Integer tiCheMoney) {
		this.tiCheMoney = tiCheMoney;
	}

	public Integer getMany() {
		return many;
	}

	public void setMany(Integer many) {
		this.many = many;
	}

	public Integer getZhiHuanSubsidy() {
		return zhiHuanSubsidy;
	}

	public void setZhiHuanSubsidy(Integer zhiHuanSubsidy) {
		this.zhiHuanSubsidy = zhiHuanSubsidy;
	}

	public Integer getFanLiPrice() {
		return fanLiPrice;
	}

	public void setFanLiPrice(Integer fanLiPrice) {
		this.fanLiPrice = fanLiPrice;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getXiuGaiDate() {
		return xiuGaiDate;
	}

	public void setXiuGaiDate(Date xiuGaiDate) {
		this.xiuGaiDate = xiuGaiDate;
	}
	
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}

	public NewCar1 getNewCar() {
		return newCar;
	}

	public void setNewCar(NewCar1 newCar) {
		this.newCar = newCar;
	}
	
	
	
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Transient
	public Integer getNerCarId() {
		return newCar==null?null:newCar.getId();
	}
	
	@Transient
	public String getName() {
		return newCar==null?null:newCar.getName();
	}
	
}
